﻿using System;

using System.Collections.Generic;
using System.Text;

namespace Silvermoon.Controls
{
    /// <summary>
    /// ModalBackground is used by modal dialogs to darken the screen and disable touching or any interaction with the controls on the screen until the 
    /// modal dialog is closed.
    /// </summary>
    /// <remarks>
    /// This class is a decorator that has a transparent background and catches all IMouseEventBehaviors.
    /// </remarks>
    public class ModalBackground:BackgroundDecorator,IMouseEventBehavior
    {
        public ModalBackground()
            : base()
        {
            Margin = new Margin(0);
        }
        #region IMouseEventBehavior Members

        public void OnMouseDown(MouseDownEventArgs e)
        {
            e.Handled = true;
        }

        public void OnMouseUp(MouseUpEventArgs e)
        {
            e.Handled = true;
        }

        public void OnMouseClick(MouseClickEventArgs e)
        {
            e.Handled = true;
        }

        public void OnMouseMove(MouseMoveEventArgs e)
        {
            e.Handled = true;
        }

        public void OnGotFocus()
        {
        }

        public void OnLostFocus()
        {
        }

        public bool IsFocused
        {
            get { return false; }
        }

        #endregion
    }
}
